package com.example.day05.exercise;

public class Worf extends Animal {
	private String name;
	private double weight;

	public Worf(String name, double weight) {
		//super();
		System.out.println("====3====");
		this.name = name;
		this.weight = weight;
	}

	//子类重写父类方法后新建对象的时候碰到同名的方法先看改方法是否重写，重写了就看子类的方法
	public String getDesc() {
		System.out.println("====2=====");
		return "Wolf:" + name + ",Weight:" + weight;
	}

	public static void main(String[] args) {
		System.out.println(new Worf("泰迪", 10));
	}
	//Wolf:null,Weight:0.0
}